﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Ord0a01
    {
        private int? _typecode;
		private string _typename;
		private string _muser;
		private string _listid;
		
        /// <summary>
        /// 订单类别
        /// </summary>
		public int? Typecode
		{
			get { return _typecode;	 }
			set { _typecode=value;	}
		}
        /// <summary>
        /// 类别名称
        /// </summary>
		public string Typename
		{
			get { return _typename;	 }
			set { _typename=value;	}
		}
        /// <summary>
        /// 用户
        /// </summary>
		public string Muser
		{
			get { return _muser;	 }
			set { _muser=value;	}
		}
        /// <summary>
        /// 主键标识
        /// </summary>
		public string Listid
		{
			get { return _listid;	 }
			set { _listid=value;	}
		}
		
		public static List<Ord0a01> GetOrd0a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Ord0a01> list = new List<Ord0a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Ord0a01 model = GetOrd0a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Ord0a01 GetOrd0a01ByDataRow(DataRow dr)
		{
			Ord0a01 model = new Ord0a01(); //实例化Ord0a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("typecode")&&!(dr["typecode"] is System.DBNull))  
				model.Typecode = ( int)dr["typecode"];
			if (dcc.Contains("typename")&&!(dr["typename"] is System.DBNull))  
				model.Typename = ( string)dr["typename"];
			if (dcc.Contains("muser")&&!(dr["muser"] is System.DBNull))  
				model.Muser = ( string)dr["muser"];
			if (dcc.Contains("listid")&&!(dr["listid"] is System.DBNull))  
				model.Listid = ( string)dr["listid"];
			
			return model;
		}
    }
}
